//
//  ScreenEdgeViewController.swift
//  testRxSwift
//
//  Created by 火星人 on 2017/7/28.
//  Copyright © 2017年 火星人. All rights reserved.
//

import UIKit
import RxGesture
import RxCocoa
import RxSwift

class ScreenEdgeViewController: BaseViewController {

    
    let disposed = DisposeBag()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let tapView = UIView(frame: CGRect(x: 0, y: 80, width: self.view.width, height: 200))
        tapView.backgroundColor = UIColor.randomColor()
        self.view.addSubview(tapView)
        
        
        tapView.rx.screenEdgePanGesture(edges: .right)
            .when(.recognized)
            .subscribe { (eve) in
                print(eve)
            }
            .disposed(by: disposed)
        
        self.view.rx.screenEdgePanGesture(edges: .right)
            .when(.recognized)
            .subscribe(onNext: { (_) in
                print("screen edge")
            })
            .disposed(by: disposed)
        
    }
    

}
